package user_service

import (
	"context"
	user2 "git.mycaigou.com/gfyx/micro-gfyx-mp-api/http_server/dto/user"
	micro_gfyx_user_service "git.mycaigou.com/gfyx/micro-gfyx-mp-api/proto/micro_gfyx_user_service_proto/micro-gfyx-user-service"
)

// GetUserInfoParams
// 请求参数
type GetUserInfoParams struct {
	OpenId    string `json:"open_id"`
	GlobalUId string `json:"global_uid"`
}

type UserRepositoryIface interface {
	// 小程序账号绑定
	MpBindUser(ctx context.Context, openId, mobile string, unionId string) (*LoginInfo, error)
	// 小程序登录
	MpLogin(ctx context.Context, openId string, unionID string) (*LoginInfo, error)
	// 短信验证码登录
	SmsLogin(ctx context.Context, request *micro_gfyx_user_service.LoginByMobileSmsRequest) (*LoginInfo, error)
	TestTenantDbEnable(ctx context.Context, x string) (string, error)

	// 获取用户信息
	GetUserInfo(ctx context.Context, params *GetUserInfoParams) (*LoginInfo, error)
	// 验证token
	VerifyToken(ctx context.Context, token string) (info *UserInfo, tenantInfo *TenantInfo, err error)
	//全量同步用户
	SyncAllUser(ctx context.Context, tenantCode string, pagesize int32) (bool, error)
	//增量同步
	IncrSyncUser(ctx context.Context, tenantCode, operation string, userList []IncrUserInfo) (bool, error)
	// 用户申请
	UserApply(ctx context.Context, mobile string) error

	//全量同步角色
	SyncAllRole(ctx context.Context, tenantCode string, pagesize int32) (bool, error)
	SyncAllUserActionRightInfos(ctx context.Context, tenantCode string) (bool, error)
	SyncTenantProfit(ctx context.Context, tenantCode string, syncAllTenantProfitRequest *user2.SyncAllTenantProfitRequest) (bool, error)
	SyncAllOrganizations(ctx context.Context, tenantCode string) (bool, error)
	SyncAllUserRoleRelation(ctx context.Context, tenantCode string, pagesize int32) (bool, error)
}
